According to the problem of premature convergence and local optimum in Firefly Algorithm (FA), this paper came up with a kind of multi-group firefly algorithm based on simulated annealing mechanism (MFA_SA), which equally divided firefly populations into many child populations with different parameter. To prevent algorithm fall into local optimum, simulated annealing mechanism was adopted to accept good solutions by the big probability, and keep bad solutions by the small probability. Meanwhile, variable distance weight was led into the process of population optimization to dynamically adjust the "vision" of firefly individual. Experiments were conducted on 5 kinds of benchmark functions between MFA_SA and three comparison algorithms. The experimental results show that, MFA_SA can find the global optimal solutions in 4 testing function, and achieve much better optimal solution, average and variance than other comparison algorithms. which demonstrates the effectiveness of the new algorithm.